<template>
  <el-main>
    <el-row>
      <el-col :span="8" v-for="(item, index) in productList" >
        <el-card :body-style="{ padding: '0px' }" >
          <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image" @click="detail(item)">
          <div style="padding: 14px;" @click="detail(item)">
            <span>{{ item.name }} {{item.price}}</span>
            <div class="bottom clearfix">
              <time class="time">{{ item.price }}</time>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </el-main>





</template>

<script>
export default {
  name: "Login",
  data() {
    return {
      productList: [],
      product:{}
    }
  },
  methods:{
    detail(product) {
      // console.log(1,id);
      this.$router.push('/product/detail?id=' + product.id);
    },

  },
  created() {
    this.axios.get('/product/t-m4-product/list',{params:{pageNo:1, pageSize: 100}}).then(res=>{
      this.productList = res.data.data;
    })
  }
}
</script>

<style scoped>
.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both
}
</style>